package com.fBlog.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity  
@Table(name="tcomment") 
@DynamicInsert(true)
@DynamicUpdate(true)
public class Tcomment implements java.io.Serializable{

	//评论序号
	private String id;
	//评论者登录名称
	private String userName;
	//评论内容
	private String content;
	//评论时间
	private Date createTime;
	//评论的动态
	private Tspeak speak;
	//回复的评论
	private Tcomment comment;
	//标记是否存在回复
	private boolean hasCom;
	
	@Id
	@Column(name = "ID", nullable = false, length = 36)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column(length = 2550)
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(length = 10240)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SPEAKID")
	public Tspeak getSpeak() {
		return speak;
	}
	public void setSpeak(Tspeak speak) {
		this.speak = speak;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COMMENTID")
	public Tcomment getComment() {
		return comment;
	}
	public void setComment(Tcomment comment) {
		this.comment = comment;
	}
	public boolean isHasCom() {
		return hasCom;
	}
	public void setHasCom(boolean hasCom) {
		this.hasCom = hasCom;
	}
}
